package com.woniu.contorller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniu.model.Result;
import com.woniu.model.UserLoginLog;
import com.woniu.server.UserLoginLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 吴彦祖
 * @since 2024年05月23日
 */
@RestController
@RequestMapping("/userLoginLog")
@Api(tags = "用户登录日志")
public class UserLoginLogController {
    @Resource
    private UserLoginLogService userLoginLogService;
    @GetMapping("/pageLoad")
    @ApiOperation("分页查询登录日志")
    public Result<Page<UserLoginLog>> pageLoad(
            @RequestParam(value = "pageNum",required = true,defaultValue = "1")
            Integer pageNum,
            @RequestParam(value = "pageSize",required = true,defaultValue = "10")
            Integer pageSize){
        Page<UserLoginLog> page = new Page<>(pageNum,pageSize);
        userLoginLogService.page(page,null);
        return Result.newPageInstance(UserLoginLog.class).setData(page);
    }
}

